﻿<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>系统登录 - 超市订单管理系统</title>
    <link type="text/css" rel="stylesheet" href="css/style.css" />
    <link type="text/css" rel="stylesheet" href="layui/css/layui.css" />
</head>
<body class="login_bg">
    <section class="loginBox">
        <header class="loginHeader">
            <h1>超市订单管理系统</h1>
        </header>
        <section class="loginCont">
	        <form id="login_form" class="loginForm">
				<div class="inputbox">
                    <label for="user">用户名：</label>
					<input type="text" class="input-text" id="name" name="name" placeholder="请输入用户名" required/>
				</div>	
				<div class="inputbox">
                    <label for="mima">密码：</label>
                    <input type="password" id="password" name="password" placeholder="请输入密码" required/>
                </div>	
				<div class="subBtn">
					
                    <input type="submit" value="登录"/>
                    <input type="reset" value="重置"/>
                </div>
			</form>
        </section>
    </section>
    
    <script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="js/jquery.form.js"></script>
    <script type="text/javascript" src="layui/layui.js"></script>
    <script type="text/javascript" src="js/mycommon.js"></script>
    <script type="text/javascript">
    	$(function(){
    		requestAjaxForm("login_form", "/SSM/login.htm", "post", "json",
    			function(data){
    				if(data.success){//接口请求正常
    					if(data.result){//登录成功
    						location.href="/SSM/view/index.html";
    					}else{//登录失败
    						layer.msg(data.message);
    					}
    				}else{//接口请求异常
    					layer.msg(data.message);
    				}
    		});
    	});
    </script>
</body>
</html>
